'use strict';
const db = uniCloud.database();
const dbCmd = db.command ;
const $ = db.command.aggregate ;
const cate = db.collection("opendb-news-categories");

module.exports = {
	
	
	list : async function(res){
		var dataInDB = await cate.field({
			"name" : 1 ,
			"sort":1,
			"description":1,
			"create_date":1
		
		}).orderBy("create_date","asc").get() ;
		var list = this.find( dataInDB );
		// list.forEach(item=>{
		// 	item.typeStr = this.getTitleByValue( TYPE_LIST , item.type);
		// });
		return {list};
	},
}